EIGEN finds eigenvalues and eignevectors for the eigenvalues from a matrix "AI". An iteration procedure is used to find the smallest or largest eigenvalue and then the associated eigenvector. Then "S" other eigenvalues are found sweeping. (S is an input parameter.) There is a boolean input parameter "Small" which determines if the smallest or largest eigenvalue is found first. If Small is TRUE then the smallest eigenvalue is found followed by the rest of the "S" eigenvalues. If small is TRUE the the matrix AI is inverted as a by product of the procedure to find the eigenvalues.
TYPE REQUIREMENTS
CONST
MAXSIZE = THE MAXIMUM SIZE OF THE INPUT ARRAY
MAXPLUS1 = MAXSIZE +1
Type
FLOAT = extended or real;
FIXXED = INTEGER;
SQUARE = array[1..MAXSIZE, 1..MAXSIZE] of FLOAT;
MYRECT = array[1..MAXPLUS1, 1..MAXSIZE] of FLOAT;
RAY = array[1..MAXSIZE] of FLOAT;
CALLING PROCEDURE
var
AI:SQUARE;{matrix of interest}
Z:Square;{output matrix of eigenvectors};
Lambda:ray;{Array of eigenvalues}
N:fixxed;{size of the matrix}
S:FIXXED;{How many eigenvalues to find}
Epsi:float;{Accuracy requirement. determines when to stop iteration in finding the first eigenvalues}
SMALL:boolean; {if small is true the smallest eigenvalue will be found first and AI will be inverted. If small is false the the largest eigenvalue will be found first}
ITERATE:FIXXED;{Number of times MULTI_DIFEQ will iterate before returning}
Define the procedure Eigen. The calling sequence to Eigen is
EIGEN(AI, LAMBDA, Z, N, S, EPSI, SMALL,ITERATE);
Define AI,N,S,EPSI and SMALL. Then call the procedure.
EIGEN(AI, LAMBDA, Z, N, S, EPSI, SMALL,ITERATE);
When the procerdure finishes, the matrix "Z" will contain the eigenvectors and "Lambda" will contain the eigenvalues. The N components of the eigenvector of corresponding to the first eigenvalue are in Z[1,1],Z[1,2]..Z[1,N].
EXAMPLE
The example defines a 3 x 3 matrix and finds 3 eigenvalues and eigenvectors starting with the largest. The eigenvalues and vectors are printed.
REFERENCES
James, M. L., Smith, G. M., Wolford, J. C.: Applied Numerical Methods for
Digital Computation With Fortran and CSMP, Harper and Row, New York,